import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

export default new VueRouter({
  linkActiveClass: "link-active",
  routes: [
    { path: "/", redirect: "/index" },
    {
      path: "/index/",
      component: (resolve) => require(["../pages/index/index.vue"], resolve),
    },
    {
      path: "/index/index/index",
      component: (resolve) => require(["../pages/index/index.vue"], resolve),
    },
    {
      path: "/index/index/index/:code",
      component: (resolve) => require(["../pages/index/index.vue"], resolve),
    },
    {
      path: "/index/index/notice",
      component: (resolve) => require(["../pages/index/notice.vue"], resolve),
    },
    {
      path: "/index/index/notice-detail/:id",
      component: (resolve) =>
        require(["../pages/index/notice-detail.vue"], resolve),
    },
    {
      path: "/index/index/detail/:id",
      component: (resolve) => require(["../pages/index/detail.vue"], resolve),
    },
    {
      path: "/index/index/detailGF/:id",
      component: (resolve) => require(["../pages/index/detailGF.vue"], resolve),
    },
    {
      path: "/index/index/form/:id",
      component: (resolve) => require(["../pages/index/form.vue"], resolve),
    },
    {
      path: "/index/index/formGF/:id",
      component: (resolve) => require(["../pages/index/formGF.vue"], resolve),
    },
    {
      path: "/index/index/doc/:type",
      component: (resolve) => require(["../pages/index/doc.vue"], resolve),
    },
    {
      path: "/index/index/clause/:id",
      component: (resolve) => require(["../pages/index/clause.vue"], resolve),
    },
    {
      path: "/index/index/clauseGF",
      component: (resolve) => require(["../pages/index/clauseGF.vue"], resolve),
    },
    {
      path: "/index/index/confirm/:id",
      component: (resolve) => require(["../pages/index/confirm.vue"], resolve),
    },
    {
      path: "/index/order/list",
      component: (resolve) => require(["../pages/order/list.vue"], resolve),
    },
    {
      path: "/index/order/list/:type",
      component: (resolve) => require(["../pages/order/list.vue"], resolve),
    },
    {
      path: "/index/order/detail/:id",
      component: (resolve) => require(["../pages/order/detail.vue"], resolve),
    },
    {
      path: "/index/order/endorse/:id",
      component: (resolve) => require(["../pages/order/endorse.vue"], resolve),
    },
    {
      path: "/index/login/login",
      component: (resolve) => require(["../pages/login/login.vue"], resolve),
    },
    {
      path: "/index/login/forgot",
      component: (resolve) => require(["../pages/login/forgot.vue"], resolve),
    },
    {
      path: "/index/login/login/:no",
      component: (resolve) => require(["../pages/login/login.vue"], resolve),
    },
    {
      path: "/index/pei/index",
      component: (resolve) => require(["../pages/pei/index.vue"], resolve),
    },
    {
      path: "/index/pei/form/:id",
      component: (resolve) => require(["../pages/pei/form.vue"], resolve),
    },
    {
      path: "/index/index/cdz2Form",
      component: (resolve) => require(["../pages/index/cdz2Form.vue"], resolve),
    },
  ],
  scrollBehavior(to, from, savedPosition) {
    // console.log('11',savedPosition);
    if (savedPosition) {
      return savedPosition;
    }
    return { x: 0, y: 0 };
  },
  mode: "history",
});
